package com.shanzmoo.platform.server.api.util;

import com.shanzmoo.base.constant.Constant;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * 加密工具
 * @author: Gzhao 2020/11/12
 */
public class BCryptUtils {

    private BCryptUtils(){}

    /**
     * 生成初始化密码
     * @return
     */
    public static String createInitPassword() {
        return encodePassword(Constant.INIT_PASSWORD);
    }

    /**
     * 生成初始化密码
     * @return
     */
    public static String encodePassword(String password) {
        BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
        return encoder.encode(password);
    }
}
